New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@amaui/subscription

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@amaui/subscription

Subscription method management

  • 1.0.11151
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

amaui logo

amaui Subscription

Subscription methods management


MIT license     Production ready     UMD 2.7kb gzipped     100% test cov     Browser and Nodejs

Very simple code     Modern code     Junior friendly     Typescript     Made with :yellow_heart:


Getting started

Add

  // yarn
  yarn add @amaui/subscription

  // npm
  npm install @amaui/subscription

Use

  import AmauiSubscription from '@amaui/subscription';

  // Make a new subscription instance
  // with an optional initial value
  const amauiSub = new AmauiSubscription('🙂');

  // Value
  amauiSub.value;

  // '🙂'

  const method = (...value) => console.log('Yup, I got it ', ...value);

  const method1 = value => console.log('Yup, I got it as well ', value);

  // Methods subscribe
  amauiSub.subscribe(method);

  amauiSub.subscribe(method1);

  // Emit a value to all subscribed methods
  // a value always emitted as arguments received by emit method
  amauiSub.emit('🌱', '🌱', '🌱', '🌱');

  // method, log:
  // Yup, I got it 🌱 🌱 🌱 🌱

  // method1, log:
  // Yup, I got it as well 🌱

  // Methods unsubscribe
  amauiSub.unsubscribe(method);

  amauiSub.unsubscribe(method1);

  // or with anonymous method
  const subscription = amauiSub.subscribe(value => console.log(value));

  subscription.unsubscribe();

Dev

Install

  yarn

Test

  yarn test

Prod

Build

  yarn build

Docs

Might be soon...

Keywords

FAQs

Package last updated on 28 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc